package scau.erps.view.base;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

import scau.erps.app.Erps;
import scau.erps.entity.Sand;
/**
 * 综合费用面板
 * @author ZJC
 *
 */
public class ComprehensiveCostsPanel extends JPanel {
	private static final long serialVersionUID = 1L;
	private JLabel tax,discount,interest,maintenanceFee,switchFee,depreciation,advertisingFee,rent,other;
	public ComprehensiveCostsPanel(){		
		JPanel	comprehensiveCostsPanel = new JPanel();				
		comprehensiveCostsPanel.setPreferredSize(new Dimension(150,300));
		comprehensiveCostsPanel.setLayout(new GridLayout(9,2));
		comprehensiveCostsPanel.setBorder(BorderFactory.createTitledBorder("综合费用"));
		JLabel taxLabel = new JLabel("所得税:");
		JLabel discountLabel = new JLabel("贴息:");
		JLabel interestLabel  = new JLabel("利息:");
		JLabel maintenanceFeeLabel  = new JLabel("维修费:");
		JLabel switchFeeLabel = new JLabel("转产费:");
		JLabel depreciationLabel = new JLabel("折旧:");
		JLabel advertisingFeeLabel = new JLabel("广告费:");
		JLabel rentLabel = new JLabel("租金:");
		JLabel otherLabel = new JLabel("其他:");
		tax = new JLabel("0");
		discount = new JLabel("0");
		interest  = new JLabel("0");
		maintenanceFee  = new JLabel("0");
		switchFee = new JLabel("0");
		depreciation = new JLabel("0");
		advertisingFee = new JLabel("0");
		rent = new JLabel("0");
		other = new JLabel("0");
		comprehensiveCostsPanel.add(taxLabel);
		comprehensiveCostsPanel.add(tax);
		comprehensiveCostsPanel.add(discountLabel);
		comprehensiveCostsPanel.add(discount);
		comprehensiveCostsPanel.add(interestLabel);
		comprehensiveCostsPanel.add(interest);
		comprehensiveCostsPanel.add(maintenanceFeeLabel);
		comprehensiveCostsPanel.add(maintenanceFee);
		comprehensiveCostsPanel.add(switchFeeLabel);
		comprehensiveCostsPanel.add(switchFee);
		comprehensiveCostsPanel.add(depreciationLabel);
		comprehensiveCostsPanel.add(depreciation);
		comprehensiveCostsPanel.add(advertisingFeeLabel);
		comprehensiveCostsPanel.add(advertisingFee);
		comprehensiveCostsPanel.add(rentLabel);
		comprehensiveCostsPanel.add(rent);
		comprehensiveCostsPanel.add(otherLabel);
		comprehensiveCostsPanel.add(other);
		this.add(comprehensiveCostsPanel);
	}
	public void setComprehensiveCostsData(){
		Sand sand = Erps.getSand(); 
		tax.setText(""+sand.getTax());
		discount.setText(""+sand.getDiscount());
		interest.setText(""+sand.getInterest());
		maintenanceFee.setText(""+sand.getMaintenanceFee());
		switchFee.setText(""+sand.getSwitchFee());
		depreciation.setText(""+sand.getDepreciation());
		advertisingFee.setText(""+sand.getAdvertisingFee());
		rent.setText(""+sand.getRent());
		other.setText(""+sand.getOther());
	}
}
